HOMEDIR=$(HOME)/EHome/Chenming

USERINCLUDE=$(HOMEDIR)/inc 
INCLUDE   = -I. -I$(USERINCLUDE)  
NETLIBS   = -ldl -lpthread 
CFLAGS= -c -g -Wall 


all:stu_info_chenming stu_info

stu_info_chenming:
	db2 connect to ehmdb user $(LOGNAME) using $(LOGNAME)	
	db2 prep stu_info_chenming.sqc bindfile
	db2 bind stu_info_chenming.bnd
	gcc -I$(DB2PATH)/include $(INCLUDE) $(CFLAGS) $@.c -o $@.o
	rm -f $@.c 

stu_info:stu_info_chenming.o
	gcc -g -s -fPIC stu_info_chenming.o $(NETLIBS) -ldb2 -o ./$@
	mv *.bnd ./bind
	rm -f *.bnd *.o
clean:
	rm -f *.bnd *.o
